/*
This program cleans UCR data and merges the data with weather and gun policy data to create the final analysis dataset
*/

timer clear
timer on 3

*Set working directory
if c(username)=="" { //insert username
cd "" // insert root path
}

if c(username)=="jmc4qg" { 
cd "/Users/jmc4qg/The Lab Dropbox/Jonathan Colmer/ShotSpotter_env/Journal_submissions/ReStat/Replication Folder" 
}

if c(username)=="jonathancolmer" { 
cd "/Users/jonathancolmer/The Lab Dropbox/Jonathan Colmer/ShotSpotter_env/Journal_submissions/ReStat/Replication Folder"
}

* List necessary programs
loc clean_ORI								= 1 // drop missing ORIs and keep relevant variables
loc clean_cc_policy							= 1 // clean gun control policies
loc build_ucr								= 1 // build UCR dataset
loc NIBRS_jurisdictions						= 1 // identify NIBRS jurisdictions
loc merge_data								= 1 // merge crime data with policy and weather dataset

*Run Programs
foreach file in clean_ORI clean_cc_policy build_ucr NIBRS_jurisdictions merge_data  {
		if ``file'' {
			do "Data Build Code/3_UCR/`file'"
		}
	}
	
timer off 3
timer list 3

disp 143.11/60 

* 2 minutes
